﻿using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using CoreLibrary;
using CoreLibrary.Email.Impl.Mandrill;

namespace Web.Config {

    public class AppSettings {

        public static bool IsProduction {
            get { return ConfigurationManager.AppSettings["Mode"].Equals("Production"); }
        }

        public static List<string> SupportEmails {
            get { 
                var emails = ConfigurationManager.AppSettings["SupportEmails"];
                return StringUtil.Split(',', emails).ToList();
            }
        }

        public static IMandrillConfig MandrillConfig {
            get {
                return new MandrillEmailConfiguration {
                       RemoteSecureEndpoint = ConfigurationManager.AppSettings["MandrillRemoteSecureEndpoint"],
                       ApiKey = ConfigurationManager.AppSettings["MandrillAPIKey"],
                       RemoteEndpoint = ConfigurationManager.AppSettings["MandrillRemoteEndpoint"],
                };
            }
        }

        public static string ConnectionStrings {
            get {
                return ConfigurationManager.AppSettings["ConnectionStrings"];
            }
        }

    }

}